//
//  YBOrderInfoVosModel.swift
//  Moonlight
//
//  Created by Penlon Kim on 2024/1/6.
//  Copyright © 2024 Moonlight Game Streaming Project. All rights reserved.
//

import UIKit

class YBOrderInfoVosModel: BaseModel, Codable {
    
    enum OrderType: Int {
        case recharge = 0
        case silverBean
        case combo
        case bgConfig
    }
    
    enum VmType: Int {
        case exclusive = 1
        case share
    }
    
    enum VmStatus: Int {
        case close = 0
        case open
    }
    
    /// 套餐分类
    var categoryValue: Int = 0
    
    /// 进入方式
    var check: String = ""
    
    /// 套餐名称
    var comboName: String = ""
    
    /// 运算 +，-
    var compare: String = ""
    
    /// cpu规格
    var cpu: String = ""
    
    /// 每日可用时长
    var dailyTime: Int = 0
    
    /// 结束时间
    var endTime: String = ""
    
    /// 套餐ID
    var goodsId: String = ""
    
    /// 商品主图
    var goodsUrl: String = ""
    
    /// 显卡名称
    var gpuName: String = ""
    
    /// 显卡类型
    var gpuType: String = ""
    
    /// 硬盘规格
    var hardPan: String = ""
    
    /// id
    var id: String = ""
    
    /// 当前排队人数
    var lineUpNum: Int = 0
    
    /// 链接方式 （RTSP，vdi, moonlight）
    var link: String = ""
    
    /// 内存规格
    var memory: String = ""
    
    /// orderId
    var orderId: String = ""
    
    /// 订单编号
    var orderSn: String = ""
    
    /// 订单类型 0，充值，1，银豆消费，2套餐 3 后台配置
    var orderType: Int = 0
    
    /// 订单类型 0，充值，1，银豆消费，2套餐 3 后台配置
    var _orderType: OrderType {
        return OrderType(rawValue: orderType) ?? .recharge
    }
    
    /// 支付金额
    var payAmount: String = ""
    
    /// 产品名称
    var productName: String = ""
    
    /// 是否购买
    var purchase: Bool = true
    
    /// 备注
    var remark: String = ""
    
    /// 排序
    var sort: Int = 0
    
    /// 剩余每日可用时长
    var surplusDaily: String = ""
    
    /// 剩余每月可用时长
    var surplusTotal: String = ""
    
    /// 套餐总时长
    var totalTime: Int = 0
    
    /// vm类型 1: 独享, 2: 共享
    var type: Int = 0
    
    /// vm类型 1: 独享, 2: 共享
    var _type: VmType {
        return VmType(rawValue: type) ?? .exclusive
    }
    
    /// 购买人
    var userId: String = ""
    
    /// vm状态 0 关机 1 开机
    var vmStatus: Int = 0
    
    /// vm状态 0 关机 1 开机
    var _vmStatus: VmStatus {
        return VmStatus(rawValue: vmStatus) ?? .close
    }
    /// 预计等待时间
    var waitTime: String = ""
    
    var _isSunshine: Bool {
        return check.contains("sunshine")
    }
}
